import { defineConfig, loadEnv } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginLess } from '@rsbuild/plugin-less';

const { publicVars } = loadEnv({ prefixes: ['REACT_APP_'] });

export default defineConfig({
  plugins: [
    pluginReact(),
    pluginLess()
  ],
  server: {
    port: 3344,
    // ppp:
    proxy: {
      "/hdapi": {
        target: 'http://121.40.211.104:5001/api', // 线上
        // target: 'http://localhost:5001/api', // 我的本地
        pathRewrite: { '^/hdapi': '' },
      },
    },
  },
  source: {
    define: publicVars,
  },
});